package ctrl;

import framework.DecisionTree;
import framework.*;

public class Controller {
	private static DecisionTree instance;
	private static boolean debug = false;
	private TreeNode node;
	int k;
	public Controller() throws Exception
	{
		instance= new DecisionTree (".\\Data\\protein1.names", ".\\Data\\protein1.dat", "no file", debug);
		instance.process();
		node=instance.getTrainingRoot();
		k=1;
	}
	public String getQuestion()
	{
		k++;
		System.out.println(instance.getQuestion(node));
		return instance.getQuestion(node);
		
	}
	public void setAnswer(int i)
	{
		node=instance.getChildren(node, i);
	}
	public String getAnswer()
	{
		return instance.getAnswer(node, k);
	}
	
	public boolean checkEnd()
	{
		if(node.children==null) return true;
		else return false;
	}
}
